package stateManager;

import java.util.HashMap;
import main.GameTree;
import main.TAdapter;

import java.util.Map;

import soundManager.SoundManager;

public class State {
	
	protected GameTree oldGameTree;
	protected GameTree gameTree;
	private boolean initialized = false;
	public StateManager stateManager;
	public SoundManager soundManager;
	
	protected Map<String, State> transitionHashMap = new HashMap<String, State>();
	public State(){
		stateManager = StateManager.getInstance();
		soundManager = SoundManager.getInstance();
	}
	
	
	public GameTree init(GameTree gameTree){
		this.initialized = true;
		this.gameTree = gameTree;
		return modifyGameTree();
		
	}
	
	public void setTransition(String key, State value){
		this.transitionHashMap.put(key, value);
	}
	
	public State getNextState(String key){
		return this.transitionHashMap.get(key);
	}
	
	public GameTree modifyGameTree(){
		return gameTree;
		
		
	}
	
	public GameTree handleInput(TAdapter userInput){
		return gameTree;
	}
	
	public boolean isInitialized(){
		return this.initialized;
	}
	
	public void setInitialized(boolean initCond){
		this.initialized= initCond;
	}

}
